<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="title" value="编辑"/>
</jsp:include>
<script src="/<%=Global.CACHE_FILE %>LuckDrawPrize_type.js"></script>
<script src="/js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/area.js" type="text/javascript"></script>
<script src="/js/selectMore.js" type="text/javascript"></script>
<form class="layui-form" style="padding-top:35px; margin-bottom: 10px; padding-right:35px;">
	<input type="hidden" name="id" value="${entity.id }" />

	<div class="layui-form-item">
		<label class="layui-form-label">奖品名称</label>
		<div class="layui-input-block">
			<input type="text" name="prizeName" class="layui-input"
				value="${entity.prizeName }">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">奖品的名称，标题</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">奖品类型</label>
		<div class="layui-input-block">
			<script type="text/javascript">writeSelectAllOptionFortype_('${entity.type }','请选择奖品类型', 1);</script>
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">奖品属于什么类型</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">奖励额度</label>
		<div class="layui-input-block">
			<input type="text" name="prizeNum" class="layui-input" value="${entity.prizeNum }"onkeyup="if(isNaN(value))execCommand('undo')" >
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">奖品积分的额度多少，如：50、100</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">奖品个数</label>
		<div class="layui-input-block">
			<input type="text" name="count" class="layui-input" value="${entity.count }"onkeyup="if(isNaN(value))execCommand('undo')">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">本次奖品个数未用到，直接设置成99999</div>
	</div>
	
	<div class="layui-form-item">
		<label class="layui-form-label">奖品等级</label>
		<div class="layui-input-block">
			<input type="text" name="prizelevel" class="layui-input" value="${entity.prizelevel }">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">奖品属于什么等级，如：一等奖、二等奖</div>
	</div>
	
	<div class="layui-form-item">
		<label class="layui-form-label">中奖概率</label>
		<div class="layui-input-block">
			<input type="text" name="prizeProbability" class="layui-input" value="${entity.prizeProbability }"onkeyup="if(isNaN(value))execCommand('undo')">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">中奖概率：比如设置的萝卜中奖概率是2、西红柿中奖概率是3，那么萝卜再实际抽奖时抽到的几率便是  2/(2+3) = 40%</div>
	</div> 
	
	<div class="layui-form-item">
		<label class="layui-form-label">奖品排序</label>
		<div class="layui-input-block">
			<input type="number" name="prizeSort" class="layui-input"
				value="${entity.prizeSort }">
		</div>
		<div class="explain" style="font-size: 12px;color: gray;padding-top: 3px;padding-left: 110px;">参与奖排序第一, 一等奖排序最后, 即奖项越大排序越靠后。 例如: 参与奖是 1, 三等奖是2, 二等奖是3, 一等奖是4</div>
	</div>
	
   	<div class="layui-form-item" style="padding-top:15px;">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
		</div>
	</div>
</form>

<script src="/js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/area.js" type="text/javascript"></script>
<!-- <script src="/js/selectMore.js" type="text/javascript"></script> -->
<script>
//自适应弹出层大小
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//parent.layer.iframeAuto(index);

layui.use(['form', 'layedit', 'laydate', 'element'], function(){
	var form = layui.form,
		element = layui.element;

	//监听提交
	form.on('submit(demo1)', function(data){
		parent.parent.msg.loading("保存中");
		var postDate = wm.getJsonObjectByForm($("form"));	//提交的表单数据
		wm.post('save.json', postDate, function (obj) { 
			parent.parent.msg.close();
			if(obj.result == '1'){
				parent.parent.msg.success("操作成功")
				parent.layer.close(index);
				parent.location.reload();	//刷新父窗口
			}else if(obj.result == '0'){
				parent.parent.msg.failure(obj.info);
			}else{
				parent.parent.msg.failure(result);
			}
		});
	    
		return false;
	});
});


</script>

<jsp:include page="/wm/common/foot.jsp"></jsp:include> 